package com.solidumgame.martillo.tablewood
{
	import com.pblabs.engine.PBE;
	import com.pblabs.engine.entity.PropertyReference;
	import com.pblabs.rendering2D.SpriteRenderer;
	
	import flash.geom.Point;
	
	
	public class TableWoodUpRendererComponent extends SpriteRenderer
	{	
		private var bodyPosition:Point;
		
		public function TableWoodUpRendererComponent()
		{
			super();
			
			this.fileName = "../assets/upTable.png";
			
			this.scene = PBE.scene;
			this.layerIndex = 1;
			//this.position = new Point(0,163);
			this.position = new Point(-400,563);
			this.size = new Point(406,44);
		}
	
		override protected function onReset():void
		{
			super.onReset();
			
		}
		
		override public function onFrame(onFrame:Number):void
		{	
			super.onFrame(onFrame);
			bodyPosition = Point(owner.getProperty(new PropertyReference("@Spatial.position")));
			this.position = new Point(bodyPosition.x,bodyPosition.y-18-15);
		}
	
	}
	
}